package com.nxy.cpfsfe;

import java.io.File;
import java.io.FilenameFilter;
import java.util.regex.Pattern;

import com.nxy.cpfsfe.enumtype.NCSChkAFileTypEnum;

/**
 * 
 * NCS侧对账文件名过滤器，用于过滤指定的NCS对账文件
 * @author jjw
 *
 */
public class NCSChkaFilenameFilter implements FilenameFilter {

	private static final String NCS_CHKAF_REGEX = "^(" + NCSChkAFileTypEnum.SUM_CHKA.getCode() + "|"
													   + NCSChkAFileTypEnum.RM_BIZ.getCode() + "|"
													   + NCSChkAFileTypEnum.NOW_DRCR_BIZ.getCode() + ")CNY.*";
	
	private Pattern pattern = Pattern.compile(NCS_CHKAF_REGEX);
	
	public boolean accept(File arg0, String arg1) {
		return pattern.matcher(arg1).matches();
	}
	
}
